package org.breathe.dynamic.thread.pool.example.config;

import lombok.extern.slf4j.Slf4j;
import org.breathe.dynamic.thread.pool.core.spring.ThreadPoolCreator;
import org.breathe.dynamic.thread.pool.core.thread.BreatheDtpExecutor;
import org.breathe.thread.pool.common.anno.BreatheDtp;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: breathe
 * @createTime: 2025-04-09
 */
@Slf4j
@Configuration
public class DynamicThreadPoolConfig {

    @Bean
    @BreatheDtp("breathe-dynamic-thread-pool")
    public BreatheDtpExecutor dynamicThreadPool() {
        return ThreadPoolCreator
                .createDynamicFast("breathe-dtp-1", "thread-factory-one");
    }

}
